package jdk8.lambda.compile;


/**
 * @Desc:   test compile lam and anoy class
 * @author: cww
 * @DateTime: 2020-06-06 21:41
 */

public class TestCompile {

    public static void testImpl1() {
        Converter<String, Integer> converter = Integer::valueOf;
        Integer i = converter.convert("12");
        System.out.println(i);
    }

    public static void testImpl2() {
        Converter<String, Integer> converter = new Converter<String, Integer>() {
            @Override
            public Integer convert(String from) {
                return Integer.valueOf(from);
            }
        };
        converter.convert("34");
    }
}

interface Converter<F,T> {
    T convert(F from);
}
